package com.kmzx.one.project.mapper;

import com.github.pagehelper.Page;
import com.kmzx.one.project.entity.UserShoppingCart;
import com.kmzx.one.project.others.dso.CartOrderDso;
import com.kmzx.one.project.others.dto.ProdOutInfo;
import com.kmzx.one.project.others.dto.UserCartInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface UserCartMapper {

    Page<UserCartInfo> selectUserCartAll(@Param("userId") String userId);

    UserShoppingCart selectByPrimaryKey(@Param("id") String id);

    int delUserCart(@Param("userId") String userId, @Param("idArray") List<String> idArray, @Param("updateTime") Date updateTime);

    List<UserShoppingCart> selectCartByUserIdSkuId(@Param("userId")String userId,@Param("skuId")String skuId);

    int updateByIdSelective(UserShoppingCart cart);

    int insert(UserShoppingCart cart);

    List<CartOrderDso> collectUserCartByIds2(List<String> list);

    Page<ProdOutInfo> selectProductByRankId(@Param("rankId") String rankId);
}
